<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./Promise.js?a=1"></script>
    <script>
        // 1- Promise.resolve
        // 如果传入的是非promise,得到的状态为成功,值为写入的值
        // const p1 = Promise.resolve(1);
        // console.log(p1);// 成功,值为1

        // 如果传入的是promise,会将promise进行返回
        const p = new Promise(resolve=>resolve(100));
        const p1 = Promise.resolve(p);
        console.log(p1,p===p1);// 成功,值为100
        
    </script>
</body>
</html>